﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VitCode.WorkFlow.Entities
{
    public class Activity : BaseEntity
    {
        public virtual bool IsUsed { get; set; }
        public virtual DateTime CreateTime { get; set; }
        public virtual DateTime? CloseTime { get; set; }
        public virtual string Name { get; set; }

        /// <summary>
        /// 重写Equals方法
        /// </summary>
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(obj, this))
                return true;
            if (obj == null)
                return false;
            var sObj = obj as Activity;
            return sObj != null && (sObj.Id == Id || sObj.Memo == Memo);
        }

        /// <summary>
        /// 重写GetHashCode方法
        /// </summary>
        public override int GetHashCode()
        {
            int hash = 37;
            hash = 21 * hash * Id.GetHashCode();
            return hash;
        }
    }
}
